package com.cw.jeeyt.service.intf.api;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.cw.jeeyt.common.Order;
import com.cw.jeeyt.service.bo.api.ApiFacadeDocBo;
import com.cw.jeeyt.service.bo.api.ApiFacadeDocDto;
import com.cw.jeeyt.api.dto.response.JsonResultDto;
import com.cw.lang.mybatis.dto.PageInfo;

/**
 * api接口文档业务接口
  * @author chenw
 * @version 1.0.0
 */
public interface ApiFacadeDocService {
    /**
     * 查询所有api接口文档列表信息
     */
    List<ApiFacadeDocBo> queryApiFacadeDocList() throws Exception;

    /**
     * 删除api接口文档
     *
     * @param apiFacadeDocBo
     */
    void delete(ApiFacadeDocBo apiFacadeDocBo) throws Exception;

    /**
     * 更新api接口文档
     *
     * @param apiFacadeDocBo
     */
    void update(ApiFacadeDocBo apiFacadeDocBo) throws Exception;

    /**
     * 更新api接口文档不为空的字段
     *
     * @param apiFacadeDocBo
     */
    void updateSelective(ApiFacadeDocBo apiFacadeDocBo) throws Exception;

    /**
     * 根据主键查询api接口文档
     *
     * @return
     */
    ApiFacadeDocBo getApiFacadeDocById(Long id) throws Exception;

    /**
     * 新增api接口文档
     *
     * @param apiFacadeDocBo
     * @return
     */
    Integer insert(ApiFacadeDocBo apiFacadeDocBo) throws Exception;

    /**
     * 新增api接口文档不为空的字段
     *
     * @param apiFacadeDocBo
     * @return
     */
    Integer insertSelective(ApiFacadeDocBo apiFacadeDocBo) throws Exception;

    /**
     * 分页查询api接口文档
     *
     * @param apiFacadeDocBo
     * @param pageNo
     * @param pageSize
     * @return
     * @throws Exception
     */
    PageInfo<ApiFacadeDocBo> queryByPage(ApiFacadeDocBo apiFacadeDocBo, Integer pageNo, Integer pageSize, Order order)
    throws Exception;

    /**
     * 查询api接口文档
     *
     * @param requestData
     * @return
     * @throws Exception
     */
    List<ApiFacadeDocBo> searchResult(String requestData) throws Exception;

    /**
     * 生成接口文档PDF及swf文件
     *
     * @param docId
     * @return
     * @throws Exception
     */
    Map<String, Object> generateReviewFile(Long docId) throws Exception;

    /**
     * 下载接口文档
     *
     * @param docId
     * @param request
     * @param response
     * @throws Exception
     */
    void downloadDoc(Long docId, HttpServletRequest request, HttpServletResponse response) throws Exception;

    /**
     * 导入接口文档
     *
     * @param request
     * @throws Exception
     */
    void importApiFacadeDoc(HttpServletRequest request) throws Exception;

    /**
     * 批量保存接口文档信息
     *
     * @param apiFacadeDocList
     * @throws Exception
     */
    void saveApiFacadeDocBat(List<ApiFacadeDocBo> apiFacadeDocList) throws Exception;

    /**
     * 根据接口编码查询接口文档信息
     *
     * @param apiDocCode
     * @return
     */
    ApiFacadeDocBo getApiFacadeDocByDocCode(String apiDocCode) throws Exception;

    /**
     * 初始化搜索界面数据
     */
    JsonResultDto initData() throws Exception;

    /**
     * 根据项目编码查询项目下的接口信息
     *
     * @param projectCode
     * @return
     */
    List<ApiFacadeDocDto> queryListByProjectCode(String projectCode);

}
